.class public Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionProcessor;
.super Ljava/lang/Object;


# instance fields
.field private collectionClass:Ljava/lang/Class;

.field private collectionData:Ljava/lang/Object;

.field private setterName:Ljava/lang/String;


# direct methods
.method public constructor <init>(Ljava/lang/String;Ljava/lang/Class;)V
    .locals 3

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    :try_start_0
    iput-object p1, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionProcessor;->setterName:Ljava/lang/String;

    iput-object p2, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionProcessor;->collectionClass:Ljava/lang/Class;

    const-string v0, "java.util.List"

    invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v0

    const-string v1, "java.util.Set"

    invoke-static {v1}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v1

    if-ne p2, v0, :cond_1

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionProcessor;->collectionData:Ljava/lang/Object;

    :cond_0
    :goto_0
    return-void

    :cond_1
    if-ne p2, v1, :cond_2

    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    iput-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionProcessor;->collectionData:Ljava/lang/Object;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-static {v0}, Lcom/wqmobile/sdk/protocol/cmd/b;->a(Ljava/lang/Exception;)V

    goto :goto_0

    :cond_2
    :try_start_1
    invoke-virtual {p2}, Ljava/lang/Class;->newInstance()Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/lang/Class;->isInstance(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_3

    invoke-virtual {p2}, Ljava/lang/Class;->newInstance()Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {v1, v0}, Ljava/lang/Class;->isInstance(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    :cond_3
    invoke-virtual {p2}, Ljava/lang/Class;->newInstance()Ljava/lang/Object;

    move-result-object v0

    iput-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionProcessor;->collectionData:Ljava/lang/Object;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0
.end method


# virtual methods
.method public addCollection(Ljava/lang/Object;)V
    .locals 6

    const/4 v4, 0x0

    if-nez p1, :cond_0

    :try_start_0
    iget-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionProcessor;->collectionData:Ljava/lang/Object;

    invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v0

    const-string v1, "add"

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/Class;

    const/4 v3, 0x0

    const-class v4, Ljava/lang/Object;

    aput-object v4, v2, v3

    invoke-virtual {v0, v1, v2}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v0

    iget-object v1, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionProcessor;->collectionData:Ljava/lang/Object;

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/Object;

    invoke-virtual {v0, v1, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    invoke-static {v0}, Lcom/wqmobile/sdk/protocol/cmd/b;->a(Ljava/lang/Exception;)V

    goto :goto_0

    :cond_0
    invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v0

    const/4 v1, 0x0

    invoke-static {v0}, Lcom/wqmobile/sdk/pojoxml/util/ClassUtil;->getPrimitiveClass(Ljava/lang/Class;)Ljava/lang/Class;

    move-result-object v2

    if-nez v2, :cond_1

    move-object v2, v0

    :cond_1
    sget-object v3, Ljava/lang/Character;->TYPE:Ljava/lang/Class;

    invoke-virtual {v0, v3}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_2

    new-instance v0, Ljava/lang/Character;

    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1, v4}, Ljava/lang/String;->charAt(I)C

    move-result v1

    invoke-direct {v0, v1}, Ljava/lang/Character;-><init>(C)V

    :goto_1
    :try_start_1
    iget-object v1, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionProcessor;->collectionData:Ljava/lang/Object;

    invoke-virtual {v1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v1

    const-string v2, "add"

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/Class;

    const/4 v4, 0x0

    const-class v5, Ljava/lang/Object;

    aput-object v5, v3, v4

    invoke-virtual {v1, v2, v3}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v1

    iget-object v2, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionProcessor;->collectionData:Ljava/lang/Object;

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    aput-object v0, v3, v4

    invoke-virtual {v1, v2, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    goto :goto_0

    :catch_1
    move-exception v0

    invoke-static {v0}, Lcom/wqmobile/sdk/protocol/cmd/b;->a(Ljava/lang/Exception;)V

    goto :goto_0

    :cond_2
    invoke-static {v0}, Lcom/wqmobile/sdk/pojoxml/util/ClassUtil;->isPrimitiveOrWrapper(Ljava/lang/Class;)Z

    move-result v0

    if-eqz v0, :cond_3

    const/4 v0, 0x1

    :try_start_2
    new-array v0, v0, [Ljava/lang/Class;

    const/4 v3, 0x0

    const-class v4, Ljava/lang/String;

    aput-object v4, v0, v3

    invoke-virtual {v2, v0}, Ljava/lang/Class;->getConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;

    move-result-object v0

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/String;

    const/4 v3, 0x0

    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v4

    aput-object v4, v2, v3

    invoke-virtual {v0, v2}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_2
    .catch Ljava/lang/SecurityException; {:try_start_2 .. :try_end_2} :catch_2
    .catch Ljava/lang/NoSuchMethodException; {:try_start_2 .. :try_end_2} :catch_3
    .catch Ljava/lang/IllegalArgumentException; {:try_start_2 .. :try_end_2} :catch_4
    .catch Ljava/lang/InstantiationException; {:try_start_2 .. :try_end_2} :catch_5
    .catch Ljava/lang/IllegalAccessException; {:try_start_2 .. :try_end_2} :catch_6
    .catch Ljava/lang/reflect/InvocationTargetException; {:try_start_2 .. :try_end_2} :catch_7

    move-result-object v0

    goto :goto_1

    :catch_2
    move-exception v0

    invoke-static {v0}, Lcom/wqmobile/sdk/protocol/cmd/b;->a(Ljava/lang/Exception;)V

    move-object v0, v1

    goto :goto_1

    :catch_3
    move-exception v0

    invoke-static {v0}, Lcom/wqmobile/sdk/protocol/cmd/b;->a(Ljava/lang/Exception;)V

    move-object v0, v1

    goto :goto_1

    :catch_4
    move-exception v0

    invoke-static {v0}, Lcom/wqmobile/sdk/protocol/cmd/b;->a(Ljava/lang/Exception;)V

    move-object v0, v1

    goto :goto_1

    :catch_5
    move-exception v0

    invoke-static {v0}, Lcom/wqmobile/sdk/protocol/cmd/b;->a(Ljava/lang/Exception;)V

    move-object v0, v1

    goto :goto_1

    :catch_6
    move-exception v0

    invoke-static {v0}, Lcom/wqmobile/sdk/protocol/cmd/b;->a(Ljava/lang/Exception;)V

    move-object v0, v1

    goto :goto_1

    :catch_7
    move-exception v0

    invoke-static {v0}, Lcom/wqmobile/sdk/protocol/cmd/b;->a(Ljava/lang/Exception;)V

    move-object v0, v1

    goto :goto_1

    :cond_3
    move-object v0, p1

    goto :goto_1
.end method

.method public getCollectionClass()Ljava/lang/Class;
    .locals 1

    iget-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionProcessor;->collectionClass:Ljava/lang/Class;

    return-object v0
.end method

.method public getCollectionData()Ljava/lang/Object;
    .locals 1

    iget-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionProcessor;->collectionData:Ljava/lang/Object;

    return-object v0
.end method

.method public getSetterName()Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionProcessor;->setterName:Ljava/lang/String;

    return-object v0
.end method

.method public setCollectionClass(Ljava/lang/Class;)V
    .locals 0

    iput-object p1, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionProcessor;->collectionClass:Ljava/lang/Class;

    return-void
.end method

.method public setCollectionData(Ljava/lang/Object;)V
    .locals 0

    iput-object p1, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionProcessor;->collectionData:Ljava/lang/Object;

    return-void
.end method

.method public setSetterName(Ljava/lang/String;)V
    .locals 0

    iput-object p1, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionProcessor;->setterName:Ljava/lang/String;

    return-void
.end method
